import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import * as path from "node:path"

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [react()],
  server: {
    proxy: {
      "/api": {
        target: "http://127.0.0.1:8080",
        rewrite: (path) => path.replace(/^\/api/, '')
      }
    }
  },
  // 路径别名
  resolve: {
    alias: {
      "@": path.resolve(__dirname, './src')
    }
  }
})
